package com.xjj.myoa.controller;

import com.xjj.myoa.dao.UserMapper;
import com.xjj.myoa.entity.OaUser;
import com.xjj.myoa.service.UserService;
import com.xjj.myoa.service.imp.UserServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resources;
import java.util.List;

@Controller
@ResponseBody
@RequestMapping("/user")
public class userController {

@Autowired
UserService userServiceimp;
@GetMapping(value="/list")
    public List<OaUser> userList(){

    List<OaUser> userList = userServiceimp.getUserList();
    for ( int  i =  0 ;i < userList.size();i++){
        System.out.println(userList.get(i));
    }
    return userList;
    }

}
